ARD2  1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
Labview.c File Reference

Provides communication routines with FSL TLS Labview interface. More...

#include "LIN_UART.h"
#include "Labview.h"
#include "utils.h"

Functions

void vfnLVMixAndMatch (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)
 This function will construct either an MP or MS data frame.
void vfnLVMixAndMatchParallel (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)
 This function will construct either an MP or MS data frame and send it using Isrs as to allow parallel execution of code.
uint8_t u8fnLabViewSendMSorMP (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Mode, uint8_t u8LabViewMsgType)
 This function will construct a data frame so that a message is shown using TLS's Labview interface.
void vfnDisplaySCIData (uint8_t u8Type, uint8_t u8BitSizeOfSample, uint8_t u8NOfStreams, uint16_t u16NOfSamples, uint8_t *pu8Data)
 This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI.
void vfnDisplaySCIDataParallel (uint8_t u8Type, uint8_t u8BitSizeOfSample, uint8_t u8NOfStreams, uint16_t u16NOfSamples, uint8_t *pu8Data)
 This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI, and sends data using Isrs so that its done in parallel to other code being executed.
void vfnLVTriggerEvent (const uint8_t u8Mask)
 This function will send a DD command to the Toulouse-based GUI. It shall act as an event trigger.
void vfnDisplaySCIRegistersInTable (uint8_t u8TableType, uint16_t u16InitAddress, uint16_t u16NOfData, uint8_t *pu8RegTable)
 This function will construct a data frame so that device registers can be accurately displayed using TLS's Labview GUI.
uint8_t u8fnLVConfigRxCmd (void)
 This routine configures the micro to receive Labview messages It should be called once at setup.
uint8_t u8fnLVReceiveCmd (void)
 This function gathers all the data in the receive buffer and constructs a message from it. Otherwise, flags it as non-existent. Result message is stored in gau8LabViewRxCmd.
void vfnLVEnable (uint8_t u8Enable)
 This function enables or disables Tx isrs, essentially pausing any pending transmission, or resuming it as necessary.
uint8_t u8fnLVWaitForTxPort (void)
 Waits for any ongoing transmission to finish.

Variables

const uint8_t cau8FakeTime []
void(*const pvfnMixNMatch [2])(uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)
uint8_t gau8LabViewMessage [LABVIEW_COMPOSITE_MESSAGE_SIZE]
uint8_t gau8LabViewRxCmd [LABVIEW_CMD_MSG_SIZE]

Detailed Description

Provides communication routines with FSL TLS Labview interface.

Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor
SASD Automotive
R11515
R20246
Version:
Date:
Warning:
(If needed)

History:


Function Documentation

uint8_t u8fnLabViewSendMSorMP ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Mode,
uint8_t  u8LabViewMsgType 
)

This function will construct a data frame so that a message is shown using TLS's Labview interface.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8ModeEither LV_SEND_IN_PARALLEL or LV_SEND_SERIALLY
u8LabViewMsgTypeeither LV_MS_MSG or LV_MP_MSG
Returns:
Always CLEAR.
uint8_t u8fnLVConfigRxCmd ( void  )

This routine configures the micro to receive Labview messages It should be called once at setup.

Parameters:
None
Returns:
UART_NOT_READY in case HW is in config mode and the operation couldn't thake place; CLEAR otherwise.
uint8_t u8fnLVReceiveCmd ( void  )

This function gathers all the data in the receive buffer and constructs a message from it. Otherwise, flags it as non-existent. Result message is stored in gau8LabViewRxCmd.

Parameters:
None
Returns:
UART_NOT_READY in case HW is in config mode and the operation couldn't thake place; CLEAR otherwise.
uint8_t u8fnLVWaitForTxPort ( void  )

Waits for any ongoing transmission to finish.

Parameters:
None.
Returns:
UART_TIMEOUT if timed-out, otherwise CLEAR.
void vfnDisplaySCIData ( uint8_t  u8Type,
uint8_t  u8BitSizeOfSample,
uint8_t  u8NOfStreams,
uint16_t  u16NOfSamples,
uint8_t *  pu8Data 
)

This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI.

Parameters:
u8Type,:LV_DA_MSG or LV_DS_MSG - Data to be graphed or others
u8BitSizeOfSample,:used as an index for either 8, 16, 24, or 32 bit data per sample per stream.
u8NOfStreams,:1 - 8, number of data streams to be sent in the package
u16NOfSamples,:Per stream to be sent.
pu8Data,:pointer to where the data that is to be sent is located.
Returns:
void.
void vfnDisplaySCIDataParallel ( uint8_t  u8Type,
uint8_t  u8BitSizeOfSample,
uint8_t  u8NOfStreams,
uint16_t  u16NOfSamples,
uint8_t *  pu8Data 
)

This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI, and sends data using Isrs so that its done in parallel to other code being executed.

Parameters:
u8Type,:LV_DA_MSG or LV_DS_MSG - Data to be graphed or others
u8BitSizeOfSample,:used as an index for either 8, 16, 24, or 32 bit data per sample per stream.
u8NOfStreams,:1 - 8, number of data streams to be sent in the package
u16NOfSamples,:Per stream to be sent.
pu8Data,:pointer to where the data that is to be sent is located.
Returns:
void.
void vfnDisplaySCIRegistersInTable ( uint8_t  u8TableType,
uint16_t  u16InitAddress,
uint16_t  u16NOfData,
uint8_t *  pu8RegTable 
)

This function will construct a data frame so that device registers can be accurately displayed using TLS's Labview GUI.

Parameters:
u8TableType,:LV_RS_MSG, LV_RR_MSG, or LV_RE_MSG.
u16InitAddress,:First address to be sent.
u16NOfData,:Size of message.
pu8RegTable,:Pointer to where the table with data is contained.
Returns:
Void.
void vfnLVEnable ( uint8_t  u8Enable)

This function enables or disables Tx isrs, essentially pausing any pending transmission, or resuming it as necessary.

Parameters:
u8Enable,:CLEAR to disable, non-zero to enable.
Returns:
void.
void vfnLVMixAndMatch ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Type 
)

This function will construct either an MP or MS data frame.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8Type,:either 0 or 1 for MS or MP.
Returns:
void.
void vfnLVMixAndMatchParallel ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Type 
)

This function will construct either an MP or MS data frame and send it using Isrs as to allow parallel execution of code.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8Type,:either 0 or 1 for MS or MP.
Returns:
void.
void vfnLVTriggerEvent ( const uint8_t  u8Mask)

This function will send a DD command to the Toulouse-based GUI. It shall act as an event trigger.

Parameters:
u8MaskMask where triggered events, from 0 to 5, are flagged in their corresponding bit.
Returns:
void.

Variable Documentation

const uint8_t cau8FakeTime[]
Initial value:
 
{
  '1', '2', '3', '4'
}

Current "time stamp" used, which happens to be fake

uint8_t gau8LabViewMessage[LABVIEW_COMPOSITE_MESSAGE_SIZE]

Global variable used as buffer for parallel transmissions

void(* const pvfnMixNMatch[2])(uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)